/*
 * Created on 2005-6-12
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package leeon;

import java.io.IOException;

import ipworks.HttpConnectedEvent;
import ipworks.HttpConnectionStatusEvent;
import ipworks.HttpDisconnectedEvent;
import ipworks.HttpEndTransferEvent;
import ipworks.HttpErrorEvent;
import ipworks.HttpEventListener;
import ipworks.HttpHeaderEvent;
import ipworks.HttpRedirectEvent;
import ipworks.HttpSetCookieEvent;
import ipworks.HttpStartTransferEvent;
import ipworks.HttpStatusEvent;
import ipworks.HttpTransferEvent;

/**
 * @author Administrator
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class HttpDownloaderEventListener implements HttpEventListener {

	HttpDownloader hd = null;
	
	public HttpDownloaderEventListener(HttpDownloader hd) {
		this.hd = hd;
	}
	
	//private HttpDownloaderEventListener() {}
	
	/* (non-Javadoc)
	 * @see ipworks.HttpEventListener#connected(ipworks.HttpConnectedEvent)
	 */
	public void connected(HttpConnectedEvent arg0) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see ipworks.HttpEventListener#connectionStatus(ipworks.HttpConnectionStatusEvent)
	 */
	public void connectionStatus(HttpConnectionStatusEvent arg0) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see ipworks.HttpEventListener#disconnected(ipworks.HttpDisconnectedEvent)
	 */
	public void disconnected(HttpDisconnectedEvent arg0) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see ipworks.HttpEventListener#endTransfer(ipworks.HttpEndTransferEvent)
	 */
	public void endTransfer(HttpEndTransferEvent arg0) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see ipworks.HttpEventListener#error(ipworks.HttpErrorEvent)
	 */
	public void error(HttpErrorEvent arg0) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see ipworks.HttpEventListener#header(ipworks.HttpHeaderEvent)
	 */
	public void header(HttpHeaderEvent arg0) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see ipworks.HttpEventListener#redirect(ipworks.HttpRedirectEvent)
	 */
	public void redirect(HttpRedirectEvent arg0) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see ipworks.HttpEventListener#setCookie(ipworks.HttpSetCookieEvent)
	 */
	public void setCookie(HttpSetCookieEvent arg0) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see ipworks.HttpEventListener#startTransfer(ipworks.HttpStartTransferEvent)
	 */
	public void startTransfer(HttpStartTransferEvent arg0) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see ipworks.HttpEventListener#status(ipworks.HttpStatusEvent)
	 */
	public void status(HttpStatusEvent arg0) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see ipworks.HttpEventListener#transfer(ipworks.HttpTransferEvent)
	 */
	public void transfer(HttpTransferEvent arg0) {
		try {
			// TODO Auto-generated method stub
			hd.content.write(arg0.text);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
